//
//  StudentModel2.m
//  ArchitectDemo
//
//  Created by 姚胜龙 on 2017/6/13.
//  Copyright © 2017年 姚胜龙. All rights reserved.
//

#import "StudentModel2.h"
#import "DeepCopyProtocol.h"

@interface StudentModel2 ()<DeepCopyProtocol>

@end

@implementation StudentModel2

- (instancetype)initWithName:(NSString *)name
                    teachers:(NSArray<TeacherModel2*> *)teachers
{
    self = [super init];
    if (self) {
        self.stuName = name;
        self.teachers = teachers;
    }
    return self;
}

- (id)deepCopy {
    NSMutableArray<TeacherModel2 *> *newArray = [NSMutableArray array];
    for (TeacherModel2 *teacher in self.teachers) {
        [newArray addObject:teacher.deepCopy];
    }
    return [[StudentModel2 alloc] initWithName:self.stuName teachers:newArray];
}

@end
